# 8  请用Python定义一个函数，给定一个字符串，找出该字符串中出现次数最多的那个字符，并打印出该字符及其出现的次数。
#  例如，输入 aaaabbc，输出：a:4
st = 'aaaabbc'

def func(st):
    dic = {}
    for i in st:
        dic[i] = dic.get(i, 0) + 1
    # print(dic)
    s = sorted(dic.items(), key=lambda x: x[1])
    # print(s[-1])
    return s[-1]

result = func(st)
alpha = result[0]
num = result[1]
print(f'{alpha}:{num}')
